package com.gxa.park.manager.config;


import com.gxa.park.manager.interceptor.AuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @date 2022/7/19
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
/* registry.addInterceptor(authInterceptor())
// 拦截所有请求，s通过判断是否有 @NeedsLogin 注解 决定是否需要提供
token
.addPathPatterns("/**")
.excludePathPatterns("/admin/login")
;*/
      /*  registry.addInterceptor(authInterceptor())
// 放行所有请求，拦截个别业务

                .addPathPatterns("/inspector/**")
                .excludePathPatterns("/inspector/login")

        ;*/
    }
    public AuthInterceptor authInterceptor() {
        return new AuthInterceptor();
    }
}
